home *** CD-ROM | disk | FTP | other *** search
- <?xml version="1.0" encoding="utf-8" ?>
- <!DOCTYPE stack PUBLIC "-//Apple, Inc.//DTD stack V 2.0//EN" "" >
- <stack>
- <name>in</name>
- <id>-1</id>
- <cardCount>225</cardCount>
- <cardID>5883</cardID>
- <listID>65961</listID>
- <cantModify><false /></cantModify>
- <cantDelete><false /></cantDelete>
- <cantAbort><false /></cantAbort>
- <cardSize>
- <width>512</width>
- <height>342</height>
- </cardSize>
- <script>on openStack
- global Manual, TheDays, Talk, byChannel, SPortGlobals, tempsecs
- global onLine, fromRcvr,commanding,instantChannel,flashing, stationList,countryList
- global BWCWidth, PBShift
- if the version < 2.0 then
- answer "This utility requires HyperCard 2.0 or later."
- go home
- end if
- set the userLevel to 5
- set lockScreen to true
- hide msg
- put "-" after menu "File"
- put "Quit Mac535" after menu "File" with menuMsgs "doLeave"
- create menu "Utils"
- put "Write file...,Read file...,Print report..." into menu "Utils"¬
- with menuMsgs "doWriteFile,doReadFile,doChannelReport"
- create menu "Scan"
- put "by Frequency...,by Channels...,by Band..." into menu "Scan"¬
- with menuMsgs "doFreqScan,doChannelScan,doBandScan"
- set icon of bg button id 40 to "receiverControl OFF"
- set the name of bg button id 40 to "Control OFF"
- put true into Manual
- put false into commanding
- set the name of bg button id 52 to "Following 535"
- hide bg button id 52
- put false into Talk
- put empty into fromRcvr
- put false into onLine
- put "Sun,Mon,Tue,Wed,Thu,Fri,Sat" into TheDays
- configureSPort modemPort,baud4800,data8,stop10,parityOff,stripOn,stripControlsOn,lineFeedsOff
- setSPortBufferSize 10240 -- use default buffer
- set the highlite of bg btn id 39 to true
- set the highlite of bg btn id 55 to true
- set the highlite of bg btn id 56 to true
- -- load station & countries lists
- put empty into stationList
- put empty into countryList
- repeat with x = 1 to the number of lines of cd field "Station List" of cd "Station Entry"
- put item 1 of line x of (cd field "Station List" of cd "Station Entry") & "," after stationList
- put item 2 of line x of (cd field "Station List" of cd "Station Entry") & "," after countryList
- end repeat
- delete the last char of stationList
- delete the last char of countryList
-
- end openStack
-
- on closeStack
- if name of bg btn id 40 is "Control ON" then
- click at the loc of bg button id 40
- end if
- reset menuBar
- closeSPort
- end closeStack
-
- on doLeave
- sendSPort "H0" & return
- reset menuBar
- go home
- end doLeave
-
-
- -- on myEscape
- -- reset menubar
- -- end myEscape
-
-
- on doWriteFile
- ask file "Enter name for report file" with "Mac535 Channel List"
- if It is empty then
- go to card "Main Control Panel"
- exit doWriteFile
- end if
- put It into fileName
- open file fileName
- visual effect dissolve fast
- go to card "Channel000"
- repeat with Num = 0 to 199
- set cursor to busy
- put empty into outRec
- put bg fld "channel #" & tab after outRec
- put bg fld "Station" & tab after outRec
- set cursor to busy
- put bg fld "Country" & tab after outRec
- put bg fld "kHz" & tab after outRec
- put bg fld "Mode" & tab after outRec
- set cursor to busy
- put bg fld "Bandwidth" & tab after outRec
- put bg fld "AGC" & tab after outRec
- put bg fld "Attenuator" & tab after outRec
- set cursor to busy
- put bg fld "Remarks" after outRec
- put return after outRec
- write outRec to file fileName
- set cursor to busy
- if Num < 199 then go to next card
- add 1 to Num
- end repeat
- close file fileName
- answer "Report completed!" with "Ok"
- visual effect dissolve fast
- go to card "Main Control Panel"
- end doWriteFile
-
- on doReadFile
- global inChannelRead
- answer "This will overwrite the channels currently stored in the stack! Do you want to do this?" with "Go Ahead" or "Cancel"
- if it is "Cancel" then
- exit doReadFile
- end if
- answer file "Enter name of file containing channel data" of type "TEXT"
- if the result is not empty then
- exit doReadFile
- end if
- put It into fileName
- open file fileName
- -- execute this loop until EOF
- put True into inChannelRead
- go to card "Channel000"
- repeat with Num = 0 to 199
- read from file fileName until return
- if it is empty then
- close file fileName
- put false into inChannelRead
- answer "File read completed!" with "Ok"
- visual effect dissolve fast
- go to card "Main Control Panel"
- exit doReadFile
- end if
- put it into msg
- -- wait until the mouseClick
- put char 1 to offset (tab,it) - 1 of it into bg fld "channel #"
- delete char 1 to offset (tab,it) of it
- put char 1 to offset (tab,it) - 1 of it into bg fld "Station"
- delete char 1 to offset (tab,it) of it
- put char 1 to offset (tab,it) - 1 of it into bg fld "Country"
- delete char 1 to offset (tab,it) of it
- put char 1 to offset (tab,it) - 1 of it into bg fld "kHz"
- delete char 1 to offset (tab,it) of it
- put char 1 to offset (tab,it) - 1 of it into bg fld "Mode"
- delete char 1 to offset (tab,it) of it
- put char 1 to offset (tab,it) - 1 of it into bg fld "Bandwidth"
- delete char 1 to offset (tab,it) of it
- put char 1 to offset (tab,it) - 1 of it into bg fld "AGC"
- delete char 1 to offset (tab,it) of it
- put char 1 to offset (tab,it) - 1 of it into bg fld "Attenuator"
- delete char 1 to offset (tab,it) of it
- put char 1 to offset (tab,it) - 1 of it into bg fld "Remarks"
- if Num < 199 then go to next card of bg "Channel Data"
- -- add 1 to Num
- end repeat
- close file fileName
- put false into inChannelRead
- answer "File read completed!" with "Ok"
- visual effect dissolve fast
- go to card "Main Control Panel"
- exit doReadFile
- end doReadFile
-
- on doChannelReport
- end doChannelReport
-
- -- on do9In
- -- set the loc of cd window to 70,70
- -- end do9In
-
- -- on do19In
- -- -- set the loc of cd window to 256,213
- -- end do19In
-
-
- on doFreqScan
- global scanHi,scanLo,scanUp
- go to card "Frequency Select"
- end doFreqScan
-
- on doChannelScan
- end doChannelScan
-
- on doBandScan
- global scanHi,scanLo,scanUp
- go to card "Band Select"
-
- end doBandScan
-
-
- on sendFreq
- global commanding
- if not commanding then
- beep
- exit sendFreq
- end if
- put bg fld "DIAL" of card 1 INTO dialTemp
- multiply dialTemp by 1000
- set numberFormat to "00000000.#"
- sendSPort "F" & dialTemp & return
- end sendFreq
-
- on doMode
- global commanding
- if not commanding then
- beep
- exit doMode
- end if
- if line 1 of BG FIELD "MODE" of card "Main Control Panel" = "RTTY" then
- sendSPort "D0" & return
- else if line 1 of BG FIELD "MODE" of card "Main Control Panel" = "CW" then
- sendSPort "D1" & return
- else if line 1 of BG FIELD "MODE" of card "Main Control Panel" = "USB" then
- sendSPort "D2" & return
- else if line 1 of BG FIELD "MODE" of card "Main Control Panel" = "LSB" then
- sendSPort "D3" & return
- else if line 1 of BG FIELD "MODE" of card "Main Control Panel" = "AM" then
- sendSPort "D4" & return
- else if line 1 of BG FIELD "MODE" of card "Main Control Panel" = "FM" then
- sendSPort "D5" & return
- else if line 1 of BG FIELD "MODE" of card "Main Control Panel" = "FAX" then
- sendSPort "D6"
- else if line 1 of BG FIELD "MODE" of card "Main Control Panel" = "ECSS-USB" then
- sendSPort "D7" & return
- else if line 1 of BG FIELD "MODE" of card "Main Control Panel" = "ECSS-LSB" then
- sendSPort "D8" & return
- end if
- end doMode
-
- on doBW
- global commanding
- if not commanding then
- flash 2
- exit doBW
- end if
- if line 1 of BG FIELD FILTER of card "Main Control Panel" = "WIDE" then
- sendSPort "B0" & return
- else if line 1 of BG FIELD FILTER of card "Main Control Panel" = "INTER" then
- sendSPort "B1" & return
- else if line 1 of BG FIELD FILTER of card "Main Control Panel" = "NARR" then
- sendSPort "B2" & return
- else if line 1 of BG FIELD FILTER of card "Main Control Panel" = "AUX" then
- sendSPort "B3" & return
- end if
- end doBW
-
- on doATT
- global commanding
- if not commanding then
- beep
- exit doATT
- end if
- if line 1 of bg field "ATT" of card "Main Control Panel" = "-0 dB" then
- sendSPort "A0" & return
- else if line 1 of bg field "ATT" of card "Main Control Panel" = "-20 dB" then
- sendSPort "A1" & return
- end if
- end doATT
-
- on doAGC
- global commanding
- if not commanding then
- beep
- exit doAGC
- end if
- if line 1 of bg field "AGC" of card "Main Control Panel" = "SLOW" then
- sendSPort "G0" & return
- else if line 1 of bg field "AGC" of card "Main Control Panel" = "FAST" then
- sendSPort "G1" & return
- else if line 1 of bg field "AGC" of card "Main Control Panel" = "OFF" then
- sendSPort "G2" & return
- end if
- end doAGC
-
- on doBWC
- get the rect of bg btn id 70
- put item 3 of it - item 1 of it into BWCWidth
- set the numberformat to "0000"
- put BWCWidth * 10 into BWCWidth
- sendSPort "W" & BWCWidth & return
- put BWCWidth && "Hz" into bg field BWCResult
- end doBWC
-
- on doPBS
- global PBShift
- set the numberformat to "0000"
- put (PBShift * 100) into PBShift
- if PBShift >= 0 then
- put "+" & PBShift into PBShift
- end if
- set the name of bg btn id 70 to pbshift
- sendSPort "P" & PBShift & return
- end doPBS
-
-
-
- on enterKey
- send mouseUp to bg button "ENTER"
- end enterKey
-
-
- -- -- -- on Idle
- -- -- -- global Manual, TheDays, onLIne, fromRcvr
- -- -- -- -- Manual says we've made a change to parameters previously set by
- -- -- -- -- a memory channel recall (this makes the "MR" indicator mimic the
- -- -- -- -- real one on the 525.
- -- -- -- if Manual is true then
- -- -- -- put empty into bg field "Mem Recall" of card "Main Control Panel"
- -- -- -- else
- -- -- -- put "MR" into bg field "Mem Recall" of card "Main Control Panel"
- -- -- -- end if
- -- -- -- -- update the UTC clock and calendar every 15 seconds
- -- -- -- put the seconds into Temp
- -- -- -- if Temp mod 15 = 0 then
- -- -- -- put Temp + (5*60*60) into TempSecs
- -- -- -- set numberFormat to "00"
- -- -- -- convert TempSecs to dateItems
- -- -- -- put (item 4 of TempSecs *1) & ":" & (item 5 of TempSecs *1) && "UTC" into bg field "UTC Time" of card "Main Control Panel"
- -- -- -- put item 7 of TempSecs into Temp
- -- -- -- put item Temp of TheDays & " " & item 2 of TempSecs & "/" & item 3 of TempSecs into bg field "UTC Date" of card "Main Control Panel"
- -- -- -- end if
- -- -- -- -- if any parameters sent from receiver, get then and update display
- -- -- -- if onLine then
- -- -- -- put recvUpTo(return,0,fromRcvr) into fromRcvr -- get chars up to a return; don't wait
- -- -- -- if fromRcvr is not empty then -- there are chars; parse them
- -- -- -- if (the last char of fromRcvr) is return then -- got a complete command
- -- -- -- delete the last char of fromRcvr -- strip the return
- -- -- -- put the first char of fromRcvr into theCmd -- extract the command identifier
- -- -- -- put fromRcvr into theParam -- put the remainder into parameter
- -- -- -- delete the first char of theParam -- strip the command letter
- -- -- -- put empty into fromRcvr -- clear for next command
- -- -- -- -- determine which command was received & process it
- -- -- -- if theCmd is "A" then
- -- -- -- if theParam is "0" then
- -- -- -- put "-0 dB" into bg fld "Att" of card "Main Control Panel"
- -- -- -- else if theParam is "1" then
- -- -- -- put "-20 dB" into bg fld "Att" of card "Main Control Panel"
- -- -- -- end if
- -- -- -- else if theCmd is "B" then
- -- -- -- if theParam is "0" then
- -- -- -- put "WIDE" into bg fld "Filter" of card "Main Control Panel"
- -- -- -- else if theParam is "1" then
- -- -- -- put "INTER" into bg fld "Filter" of card "Main Control Panel"
- -- -- -- else if theParam is "2" then
- -- -- -- put "NARR" into bg fld "Filter" of card "Main Control Panel"
- -- -- -- else if theParam is "3" then
- -- -- -- put "AUX" into bg fld "Filter" of card "Main Control Panel"
- -- -- -- end if
- -- -- -- else if theCmd is "C" then
- -- -- -- set numberFormat to "000"
- -- -- -- put theParam + 0 into bg fld "Channel" of card "Main Control Panel"
- -- -- -- else if theCmd is "D" then
- -- -- -- if theParam is "0" then
- -- -- -- put "RTTY" into bg fld "Mode" of card "Main Control Panel"
- -- -- -- else if theParam is "1" then
- -- -- -- put "CW" into bg fld "Mode" of card "Main Control Panel"
- -- -- -- else if theParam is "2" then
- -- -- -- put "USB" into bg fld "Mode" of card "Main Control Panel"
- -- -- -- else if theParam is "3" then
- -- -- -- put "LSB" into bg fld "Mode" of card "Main Control Panel"
- -- -- -- else if theParam is "4" then
- -- -- -- put "AM" into bg fld "Mode" of card "Main Control Panel"
- -- -- -- else if theParam is "5" then
- -- -- -- put "FM" into bg fld "Mode" of card "Main Control Panel"
- -- -- -- else if theParam is "6" then
- -- -- -- put "FAX" into bg fld "Mode" of card "Main Control Panel"
- -- -- -- end if
- -- -- -- else if theCmd is "F" then
- -- -- -- set numberFormat to "####0.00"
- -- -- -- divide theParam by 100
- -- -- -- put theParam into bg fld "Dial" of card "Main Control Panel"
- -- -- -- else if theCmd is "G" then
- -- -- -- if theParam is "0" then
- -- -- -- put "SLOW" into bg fld "AGC" of card "Main Control Panel"
- -- -- -- else if theParam is "1" then
- -- -- -- put "FAST" into bg fld "AGC" of card "Main Control Panel"
- -- -- -- else if theParam is "2" then
- -- -- -- put "OFF" into bg fld "AGC" of card "Main Control Panel"
- -- -- -- end if
- -- -- -- else
- -- -- -- put "Unknown response: " & theCmd into msg
- -- -- -- end if
- -- -- -- else
- -- -- -- -- save for next idle invocation
- -- -- -- end if
- -- -- -- end if
- -- -- -- end if
- -- -- -- end idle
-
-
- on Idle
- global Manual, TheDays, onLIne, fromRcvr, commanding, tempSecs
- -- Manual says we've made a change to parameters previously set by
- -- a memory channel recall (this makes the "MR" indicator mimic the
- -- real one on the 525.
- if Manual is true then
- put empty into bg field "Mem Recall" of card "Main Control Panel"
- else
- put "MR" into bg field "Mem Recall" of card "Main Control Panel"
- end if
- -- update the UTC clock and calendar every 15 seconds
- put the seconds into Temp
- if Temp mod 15 = 0 then
- put Temp + (4*60*60) into TempSecs ---------***************
- set numberFormat to "00"
- convert TempSecs to dateItems
- put (item 4 of TempSecs *1) & ":" & (item 5 of TempSecs *1) into bg field "UTC Time" of card "Main Control Panel"
- put item 7 of TempSecs into Temp
- put item Temp of TheDays & " " & item 2 of TempSecs & "/" & item 3 of TempSecs into bg field "UTC Date" of card "Main Control Panel"
- end if
- -- if any parameters sent from receiver, get then and update display
-
- -- ################### "I1" ROUTINE ######################
-
- if onLine then
- -- following test checks for zillions of chars coming from rcvr in "following"
- -- mode. If more than about one full param set's available, just kill
- -- them all and issue a new inquiry. This keeps the display up-to-date
- -- at all times.
- if (not commanding) and (charsAvailable() > 30) then
- killSPort In
- sendSPort "I1" & return
- end if
- put recvUpTo(return,0,fromRcvr) into fromRcvr -- get chars up to a return; don't wait
- if fromRcvr is not empty then -- there are chars; parse them
- if (the last char of fromRcvr) is return then -- got a complete command
- delete the last char of fromRcvr -- strip the return
- put the first char of fromRcvr into theCmd -- extract the command identifier
- put fromRcvr into theParam -- put the remainder into parameter
- delete the first char of theParam -- strip the command letter
- put empty into fromRcvr -- clear for next command
- -- NOTE: the following code is skipped if we're commanding to keep
- -- the receiver's echos from screwing up the display
- if not commanding then
- -- determine which command was received & process it
- if theCmd is "F" then -- put this first in list 'cause it's the most common
- -- put true into Manual
- set numberFormat to "####0.000"
- divide theParam by 1000
- put theParam into bg fld "Dial" of card "Main Control Panel"
- else if theCmd is "A" then
- -- put true into Manual
- if theParam is "0" then
- put "-0 dB" into bg fld "Att" of card "Main Control Panel"
- else if theParam is "1" then
- put "-20 dB" into bg fld "Att" of card "Main Control Panel"
- end if
- else if theCmd is "B" then
- -- put true into Manual
- if theParam is "0" then
- put "WIDE" into bg fld "Filter" of card "Main Control Panel"
- else if theParam is "1" then
- put "INTER" into bg fld "Filter" of card "Main Control Panel"
- else if theParam is "2" then
- put "NARR" into bg fld "Filter" of card "Main Control Panel"
- else if theParam is "3" then
- put "AUX" into bg fld "Filter" of card "Main Control Panel"
- end if
- else if theCmd is "C" then -- ignore to keep from conflicting with OUR chanel
- -- put false into Manual
- -- set numberFormat to "000"
- -- put theParam + 0 into bg fld "Channel"